import 'dart:convert' show json;

class Test {

  List<Test1> list;

  Test.fromParams({this.list});

  factory Test(jsonStr) => jsonStr == null ? null : jsonStr is String ? new Test.fromJson(json.decode(jsonStr)) : new Test.fromJson(jsonStr);

  Test.fromJson(jsonRes) {
    list = jsonRes['list'] == null ? null : [];

    for (var listItem in list == null ? [] : jsonRes['list']){
      list.add(listItem == null ? null : new Test1.fromJson(listItem));
    }
  }

  @override
  String toString() {
    return '{"list": $list}';
  }
}

class Test1 {

  int age;
  int pro;
  int sex;
  int uid;
  int vip;
  String distance;
  String icon;
  String latitude;
  String longitude;
  String nickname;
  String time;
  String zodiac;
  List<String> img;

  Test1.fromParams({this.age, this.pro, this.sex, this.uid, this.vip, this.distance, this.icon, this.latitude, this.longitude, this.nickname, this.time, this.zodiac, this.img});

  Test1.fromJson(jsonRes) {
    age = jsonRes['age'];
    pro = jsonRes['pro'];
    sex = jsonRes['sex'];
    uid = jsonRes['uid'];
    vip = jsonRes['vip'];
    distance = jsonRes['distance'];
    icon = jsonRes['icon'];
    latitude = jsonRes['latitude'];
    longitude = jsonRes['longitude'];
    nickname = jsonRes['nickname'];
    time = jsonRes['time'];
    zodiac = jsonRes['zodiac'];
    img = jsonRes['img'] == null ? null : [];

    for (var imgItem in img == null ? [] : jsonRes['img']){
      img.add(imgItem);
    }
  }

  @override
  String toString() {
    return '{"age": $age,"pro": $pro,"sex": $sex,"uid": ${uid != null?'${json.encode(uid)}':'null'},"vip": $vip,"distance": $distance,"icon": ${icon != null?'${json.encode(icon)}':'null'},"latitude": ${latitude != null?'${json.encode(latitude)}':'null'},"longitude": ${longitude != null?'${json.encode(longitude)}':'null'},"nickname": ${nickname != null?'${json.encode(nickname)}':'null'},"time": ${time != null?'${json.encode(time)}':'null'},"zodiac": ${zodiac != null?'${json.encode(zodiac)}':'null'},"img": $img}';
  }
}
